Re: [INTERFACES] Determine data type of columns

Поиск
Список
Период
Сортировка
От Herouth Maoz
Тема Re: [INTERFACES] Determine data type of columns
Дата
Msg-id l03110701b26f0f0c4c43@[147.233.159.109]
обсуждение исходный текст
Ответ на Determine data type of columns  ("Bryan White" <bryan@arcamax.com>)
Список pgsql-interfaces
At 23:21 +0200 on 10/11/98, Bryan White wrote:


> I have a general purpose utilty for entering data into web based forms.  The
> function that parses the data and inserts the record into a table is largely
> unaware of the structure of the table it is operating on.  I am currenly
> having problems with integer fields.  If I blindly quote all fields the back
> end will complain about casting on integer fields.  Also I would like to do
> some primitive field validation based on type before submitting to the back
> end.

It may be worth noticing that if you use COPY rather than INSERT, you don't
have to quote neither numbers nor other data types. You do have to quote
delimiter characters (tab, newline, backslash - or whatever you chose as
your copy delimiters) with a backslash. That can be easily done even with
the most "blind" front end, which knows nothing about the fields.

I know, I know. You want to do updates and some type-based data checking as
well. But this may be the answer in cases you don't, and be faster at that.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma



В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Herouth Maoz
Дата:
Сообщение: Re: [INTERFACES] how to obtain column info
Следующее
От: "Gene Selkov Jr."
Дата:
Сообщение: Re: [INTERFACES] need information about storing methods